package com.dsg.service.approve.impl;

import com.dsg.common.util.SingletonLoginUtils;
import com.dsg.dao.approve.DsgApproveCaseMapper;
import com.dsg.entity.apply.DsgApplyBill;
import com.dsg.entity.approve.DsgApproveCase;
import com.dsg.service.DsgServiceImpl;
import com.dsg.service.approve.IDsgApproveCaseService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 實例動態表 服务实现类
 * </p>
 *
 * @author system
 * @since 2020-07-04
 */
@Service
public class DsgApproveCaseServiceImpl extends DsgServiceImpl<DsgApproveCaseMapper, DsgApproveCase> implements IDsgApproveCaseService {

    @Override
    public List<DsgApproveCase> getTaskList(String userId) {
        return baseMapper.getTaskList(userId);
    }

    @Override
    public DsgApproveCase getStartedDeduOneCase(String appNo) {
        return baseMapper.getStartedDeduOneCase(appNo, SingletonLoginUtils.getSystemUserId());
    }

    @Override
    public DsgApproveCase getDeduOneCase(String appNo) {
        return baseMapper.getDeduOneCase(appNo, SingletonLoginUtils.getSystemUserId());
    }

    @Override
    public DsgApproveCase getBeginCase(DsgApplyBill bill) {
        bill.setUserId(SingletonLoginUtils.getSystemUserId());
        return baseMapper.getBeginCase(bill);
    }

    @Override
    public DsgApproveCase getCase(String nodeName, String appNo) {
        return baseMapper.getCase(nodeName, appNo, SingletonLoginUtils.getSystemUserId());
    }

    @Override
    public List<DsgApproveCase> timeoutCaseList() {
        return baseMapper.timeoutCaseList();
    }

    @Override
    public DsgApproveCase getApprovedCaseByNode(String nodeId, String appNo) {
        return baseMapper.getApprovedCaseByNode(nodeId, appNo);
    }

    @Override
    public DsgApproveCase getApplyCase(String applyNo) {
        return baseMapper.getApplyCase(applyNo, SingletonLoginUtils.getSystemUserId());
    }
}
